ret = -ESRCH;
v = d->vcpu[op->u.getvcpucontext.vcpu];
- if ( (v == NULL) || test_bit(_VCPUF_down, &v->vcpu_flags) )
+ if ( (v == NULL) || !test_bit(_VCPUF_initialised, &v->vcpu_flags) )
goto getvcpucontext_out;
ret = -ENOMEM;
goto getvcpuinfo_out;
ret = -ESRCH;
- v = d->vcpu[op->u.getvcpuinfo.vcpu];
- if ( (v == NULL) || test_bit(_VCPUF_down, &v->vcpu_flags) )
+ if ( (v = d->vcpu[op->u.getvcpuinfo.vcpu]) == NULL )
goto getvcpuinfo_out;
+ op->u.getvcpuinfo.online = !test_bit(_VCPUF_down, &v->vcpu_flags);
+ op->u.getvcpuinfo.blocked = test_bit(_VCPUF_blocked, &v->vcpu_flags);
+ op->u.getvcpuinfo.running = test_bit(_VCPUF_running, &v->vcpu_flags);
op->u.getvcpuinfo.cpu_time = v->cpu_time;
op->u.getvcpuinfo.cpu = v->processor;
op->u.getvcpuinfo.cpumap = v->cpumap;
domid_t domain; /* domain to be affected */
uint16_t vcpu; /* vcpu # */
/* OUT variables. */
- uint64_t cpu_time;
+ uint8_t online; /* currently online (not hotplugged)? */
+ uint8_t blocked; /* blocked waiting for an event? */
+ uint8_t running; /* currently scheduled on its CPU? */
+ uint64_t cpu_time; /* total cpu time consumed (ns) */
uint32_t cpu; /* current mapping */
cpumap_t cpumap; /* allowable mapping */
} dom0_getvcpuinfo_t;